# $Id: PKGBUILD 85369 2013-03-01 10:34:56Z andrea $
# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgbase=libaccounts-qt
_pkgbase=accounts-qt
pkgname=('libaccounts-qt' 'libaccounts-qt-doc')
pkgver=1.6
pkgrel=2
pkgdesc="Qt-based client library for accessing the online accounts database"
arch=('i686' 'x86_64')
url="http://code.google.com/p/accounts-sso/"
license=('LGPL')
depends=('qt4' 'libaccounts-glib')
makedepends=('doxygen' 'graphviz' 'ttf-dejavu')
options=('!emptydirs')
source=(http://accounts-sso.googlecode.com/files/$_pkgbase-$pkgver.tar.bz2)
sha1sums=('bd2c02b747384d53b75767c18b1e026bcf2211c5')

build() {
  cd "$srcdir/$_pkgbase-$pkgver"

  # Do not install tests
  echo 'INSTALLS =' >>tests/accountstest.pro

  qmake PREFIX=/usr LIBDIR=/usr/lib
  make
}

package_libaccounts-qt() {
  cd "$srcdir/$_pkgbase-$pkgver"

  make INSTALL_ROOT="$pkgdir" install

  # Split out documentation
  mv "$pkgdir/usr/share/doc" "$srcdir"
}

package_libaccounts-qt-doc() {
  pkgdesc="Developer documention of signon"
  depends=()

  mkdir -p "$pkgdir/usr/share"
  mv "$srcdir/doc" "$pkgdir/usr/share"
}
